class Dictionary {
  constructor() {
    this.datastore = []
  }

  add(key, value) {
    this.datastore[key] = value
  }

  find(key) {
    return this.datastore[key]
  }

  remove(key) {
    delete this.datastore[key]
  }

  showAll() {
    for(let key of Object.keys(this.datastore)) {
      console.log('key:' + key + '\nvalue:' +  this.datastore[key])
    }
  }

  count() {
    return this.datastore.length
  }

  clear() {
    this.datastore = []
  }
  
}

const dictionary = new Dictionary()
dictionary.add('who', 'me')
dictionary.add('why', 'I dont known')
dictionary.showAll()
dictionary.remove('who')
dictionary.showAll()
dictionary.clear()
dictionary.showAll()
